package rad.framework.mda.generator.template.test.resources;

public class LoginConfig
{
  protected static String nl;
  public static synchronized LoginConfig create(String lineSeparator)
  {
    nl = lineSeparator;
    LoginConfig result = new LoginConfig();
    nl = null;
    return result;
  }

  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
  protected final String TEXT_1 = "<?xml version='1.0'?>" + NL + "" + NL + "<!DOCTYPE policy PUBLIC" + NL + "      \"-//JBoss//DTD JBOSS Security Config 3.0//EN\"" + NL + "      \"http://www.jboss.org/j2ee/dtd/security_config.dtd\">" + NL + "" + NL + "<!-- The XML based JAAS login configuration read by the" + NL + "org.jboss.security.auth.login.XMLLoginConfig mbean. Add" + NL + "an application-policy element for each security domain." + NL + "" + NL + "The outline of the application-policy is:" + NL + "<application-policy name=\"security-domain-name\">" + NL + "  <authentication>" + NL + "    <login-module code=\"login.module1.class.name\" flag=\"control_flag\">" + NL + "      <module-option name = \"option1-name\">option1-value</module-option>" + NL + "      <module-option name = \"option2-name\">option2-value</module-option>" + NL + "      ..." + NL + "    </login-module>" + NL + "" + NL + "    <login-module code=\"login.module2.class.name\" flag=\"control_flag\">" + NL + "      ..." + NL + "    </login-module>" + NL + "    ..." + NL + "  </authentication>" + NL + "</application-policy>" + NL + "" + NL + "$Revision: 1.2 $" + NL + "-->" + NL + "" + NL + "<policy>" + NL + "  <!-- Used by clients within the application server VM such as" + NL + "  mbeans and servlets that access EJBs." + NL + "  -->" + NL + "  <application-policy name=\"client-login\">" + NL + "    <authentication>" + NL + "      <login-module code=\"org.jboss.security.ClientLoginModule\"" + NL + "        flag=\"required\">" + NL + "         <!-- Any existing security context will be restored on logout -->" + NL + "         <module-option name=\"restore-login-identity\">true</module-option>" + NL + "      </login-module>" + NL + "    </authentication>" + NL + "  </application-policy>" + NL + "" + NL + "  <application-policy name=\"rad-framework\">" + NL + "    <!-- A simple server login module, which can be used when the number" + NL + "    of users is relatively small. It uses two properties files:" + NL + "    users.properties, which holds users (key) and their password (value)." + NL + "    roles.properties, which holds users (key) and a comma-separated list of" + NL + "    their roles (value)." + NL + "    The unauthenticatedIdentity property defines the name of the principal" + NL + "    that will be used when a null username and password are presented as is" + NL + "    the case for an unuathenticated web client or MDB. If you want to" + NL + "    allow such users to be authenticated add the property, e.g.," + NL + "    unauthenticatedIdentity=\"nobody\"" + NL + "    -->" + NL + "    <authentication>" + NL + "\t\t<login-module" + NL + "\t\t\tcode=\"org.jboss.security.auth.spi.DatabaseServerLoginModule\"" + NL + "\t\t\tflag=\"required\">" + NL + "\t\t\t<module-option name=\"dsJndiName\">java:/DefaultDS</module-option>" + NL + "\t\t\t<module-option name=\"principalsQuery\">select password from TUser where id=?</module-option>" + NL + "\t\t\t<module-option name=\"rolesQuery\">select membership_id,'Roles' from TGroup_TUser where members_id=?</module-option>" + NL + "\t\t\t<module-option name=\"hashAlgorithm\">MD5</module-option>" + NL + "\t\t\t<module-option name=\"hashEncoding\">base64</module-option>" + NL + "\t\t</login-module>" + NL + "    </authentication>" + NL + "  </application-policy>" + NL + "" + NL + "</policy>" + NL;
  protected final String TEXT_2 = NL;

  public String generate(Object argument)
  {
    final StringBuffer stringBuffer = new StringBuffer();
    

    stringBuffer.append(TEXT_1);
    stringBuffer.append(TEXT_2);
    return stringBuffer.toString();
  }
}
